#ifndef TEMHISWIG_H
#define TEMHISWIG_H

#include <QDebug>
#include <QWidget>


#include "qcustomplot.h"
#include "mqtt/qmqtt.h"
#include "globalval.h"

#include "QTime"
#include "modbuswig.h"
#include <QRegExp>
#include <QDebug>
#include <QJsonDocument>
#include <QJsonArray>
#include <QJsonObject>

namespace Ui {
class TemHisWig;
}

class TemHisWig : public QWidget
{
    Q_OBJECT

public:
    explicit TemHisWig(QWidget *parent = 0);
    ~TemHisWig();

private slots:
    void temHisplotData( QByteArray &jsonData);
    void on_pushButton_clicked();
    void temHistoryDownSlot(QString key, QString topic, QString startDate, QString endDate);
    void setupHistoryDataDemo();
private:
    Ui::TemHisWig *ui;

    QCustomPlot *customPlot; // 声明 customPlot 成员变量
    QVector<QPointF> tempData; // 存储时间戳和温度数据
    void setupHistoryDataDemo(QCustomPlot *customPlot);
    void parseAndUpdatePlot(QByteArray jsonData);
     void updateHistoryPlot();
//     void on_pushButton_clicked();
 //        void temHistoryDownSlot(QString key, QString topic, QString startDate, QString endDate);

         QVector<double> xData, yData;
};

#endif // TEMHISWIG_H
